package com.haiyuancloud.create.properties.impl;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.haiyuancloud.create.properties.HyDataSourceProperties;
import com.haiyuancloud.base.deal.core.chain.compile.model.HyDealDBModel;
import com.haiyuancloud.create.properties.abs.AbsHyDataSourceProperties;
import lombok.extern.log4j.Log4j;
import org.springframework.stereotype.Service;

@Log4j
@Service("com.haiyuancloud.create.properties.impl.DealDataSourceProperties")
public class DealDataSourceProperties extends AbsHyDataSourceProperties {

    @NacosValue(value = "${spring.datasource.dynamic.datasource.DEAL_447943785935011002.url}", autoRefreshed = true)
    private String url;

    @NacosValue(value = "${spring.datasource.dynamic.datasource.DEAL_447943785935011002.username}", autoRefreshed = true)
    private String username;

    @NacosValue(value = "${spring.datasource.dynamic.datasource.DEAL_447943785935011002.password}", autoRefreshed = true)
    private String password;

    private String dataSource = "DEAL_447943785935011002";

    @Override
    public String getUrl() {
        return url;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getDataSource() {
        return dataSource;
    }
}
